<?php

class Action_Node_ShowRegistration extends RL_Handler
{
	private $template_data = array();
	
	private function toTemplate(array $to_add) {
		$this->template_data = array_merge($to_add, $this->template_data);
	}
	
	public function init() {
		$this->rh->UseClass('RL_CyrDate');
		$this->acla = $this->module->aa;
		$this->acld = $this->acla->getInfo();
		$this->acla->getAvailableOperations();
		$this->store = &$this->ctx->store;
	}
	
	public function process ()
	{
		$this->toTemplate( $this->acla->template_data );
		
		// set view
		$view = $this->rh->views->findByName('registration');
		$view->data = $this->template_data;
		
		$view->data['reg_iframe_url'] = $this->rh->idsrv_regiframe_url;
		
		$view->data['trust_root'] = urlencode($this->rh->base_url);
		$view->data['return_url'] = urlencode(trim($this->rh->base_url, "/")."/login?openid_action=login&ref=".$this->rh->base_url);
		
		$this->rh->response->setContent( $view );
	} // end of function execute

}
